#ifndef TANK_H
#define TANK_H

#include <QObject>
#include <QPainter>
#include <QKeyEvent>

enum direction{
    xup,xright,xdown,xleft
};

class Tank : public QObject
{
    Q_OBJECT
public:
    int pos_x;
    int pos_y;
    direction mydir;
    int moveStep;
    int QuickmoveStep;
    explicit Tank(int key1,int key2,int key3,int key4,QObject *parent = nullptr);
    void DrawTank(QPainter* p,direction d);
    void move(int dx,int dy);
    bool iscollide(int dx, int dy);
    void HowMove(QKeyEvent* event);

private:
    QImage tank;
    const int my_up;
    const int my_down;
    const int my_left;
    const int my_right;


signals:

};

#endif // TANK_H
